﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="generalCondition.ascx.cs" Inherits="VISS.Web.Frontend.Modules.User.Profile.GeneralConditionControl" %>

<%@ Import Namespace="VISS.Web.Frontend" %>
<%@ Import Namespace="VISS.API.Users" %>

<div id="general-condition" class="form">
    <div id="general-condition-field">
        <% if (GeneralCondition == null) {
               if (IsEditPersional) { %> 
                    <div class="field">
                        <label class="title">Độ tuổi:</label>
                        <div class="right"><span id="field-condition-old">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Chiều cao:</label>
                        <div class="right"><span id="field-condition-height">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Cân nặng:</label>
                        <div class="right"><span id="field-condition-weight">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Sống tại:</label>
                        <div class="right"><span id="field-condition-city">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Nghề nghiệp:</label>
                        <div class="right"><span id="field-condition-job">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Trình độ học vấn:</label>
                        <div class="right"><span id="field-condition-education">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Thu nhập:</label>
                        <div class="right"><span id="field-condition-income">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Tôn giáo:</label>
                        <div class="right"><span id="field-condition-religion">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Tình trạng hôn nhân:</label>
                        <div class="right"><span id="field-condition-maritalStatus">Chưa cung cấp</span></div>
                    </div>
                    <div class="field">
                        <label class="title">Hút thuốc:</label>
                        <div class="right"><span id="field-condition-smoking">Chưa cung cấp</span></div>
                    </div>
            <% }
               else { %>
                    <div class="empty">Thành viên này hiện chưa cung cấp thông tin</div>
            <% } %>
        <% }
           else { %>
            <div class="field">
                <label class="title">Độ tuổi:</label>
                <div class="right">
                    <span id="field-condition-old">
                        <% if (GeneralCondition.OldMin == 0 && GeneralCondition.OldMax == 0) {
                               Response.Write("Không quan tâm");
                           }
                           else {
                               if (GeneralCondition.OldMin == 0 && GeneralCondition.OldMax > 0) {
                                   Response.Write("Từ " + GeneralCondition.OldMax + " tuổi trở xuống");
                               }
                               else if (GeneralCondition.OldMin > 0 && GeneralCondition.OldMax == 0) {
                                   Response.Write("Từ " + GeneralCondition.OldMax + " tuổi trở lên");
                               }
                               else {
                                   Response.Write("Từ " + GeneralCondition.OldMin + " đến " + GeneralCondition.OldMax + " tuổi");
                               }
                           } %>
                    </span>
                </div>
            </div>
            <div class="field">
                <label class="title">Chiều cao:</label>
                <div class="right">
                    <span id="field-condition-height">
                        <% if (GeneralCondition.HeightMin == 0 && GeneralCondition.HeightMax == 0) {
                               Response.Write("Không quan tâm");
                           }
                           else {
                               if (GeneralCondition.HeightMin == 0 && GeneralCondition.HeightMax > 0) {
                                   Response.Write("Từ " + Commons.ConvertCmToMet(GeneralCondition.HeightMax, true) + " trở xuống");
                               }
                               else if (GeneralCondition.HeightMin > 0 && GeneralCondition.HeightMax == 0) {
                                   Response.Write("Từ " + Commons.ConvertCmToMet(GeneralCondition.HeightMin, true) + " trở lên");
                               }
                               else {
                                   Response.Write("Từ " + Commons.ConvertCmToMet(GeneralCondition.HeightMin, true) + " đến " + Commons.ConvertCmToMet(GeneralCondition.HeightMax, true));
                               }
                           } %>
                    </span>
                </div>
            </div>
            <div class="field">
                <label class="title">Cân nặng:</label>
                <div class="right">
                    <span id="field-condition-weight">
                        <% if (GeneralCondition.WeightMin == 0 && GeneralCondition.WeightMax == 0) {
                               Response.Write("Không quan tâm");
                           }
                           else {
                               if (GeneralCondition.WeightMin == 0 && GeneralCondition.WeightMax > 0) {
                                   Response.Write("Từ " + GeneralCondition.WeightMax + " Kg trở xuống");
                               }
                               else if (GeneralCondition.WeightMin > 0 && GeneralCondition.WeightMax == 0) {
                                   Response.Write("Từ " + GeneralCondition.WeightMin + " Kg trở lên");
                               }
                               else {
                                   Response.Write("Từ " + GeneralCondition.WeightMin + " đến " + GeneralCondition.WeightMax + " Kg");
                               }
                           } %>
                    </span>
                </div>
            </div>
            <div class="field">
                <label class="title">Sống tại:</label>
                <div class="right"><span id="field-condition-city"><%=GeneralCondition.Cities %></span></div>
            </div>
            <div class="field">
                <label class="title">Nghề nghiệp:</label>
                <div class="right"><span id="field-condition-job"><%=GeneralCondition.Jobs %></span></div>
            </div>
            <div class="field">
                <label class="title">Trình độ học vấn:</label>
                <div class="right"><span id="field-condition-education"><%=GeneralCondition.Education %></span></div>
            </div>
            <div class="field">
                <label class="title">Thu nhập:</label>
                <div class="right">
                    <span id="field-condition-income">
                    <% if (GeneralCondition.Income > 0) { %>
                           trên <%=Commons.IntToViewString(GeneralCondition.Income) %> VNĐ
                    <% }
                       else {
                           Response.Write(DontCare);
                       } %>
                    
                    </span>
                </div>
            </div>
            <div class="field">
                <label class="title">Tôn giáo:</label>
                <div class="right"><span id="field-condition-religion"><%=GeneralCondition.Religion %></span></div>
            </div>
            <div class="field">
                <label class="title">Tình trạng hôn nhân:</label>
                <div class="right"><span id="field-condition-maritalStatus"><%=GeneralCondition.MaritalStatus %></span></div>
            </div>
            <div class="field">
                <label class="title">Hút thuốc:</label>
                <div class="right"><span id="field-condition-smoking"><%=GeneralCondition.Smoking %></span></div>
            </div>
        <% } %>
        <% if (IsEditPersional == true) { %>
            <div class="field-edit">
                <span class="edit-box" id="edit-general-condition">Chỉnh sửa</span>
            </div>
        <% } %>
    </div>
    <% if (IsEditPersional == true) {
           if (GeneralCondition == null) {
               GeneralCondition = new VISS.API.Users.UserGeneralConditionEnt();
               GeneralCondition.CityIDs = "-1";
               CityID = -1;
               GeneralCondition.JobIDs = "-1";
               JobID = -1;
               GeneralCondition.Income = 0;
               GeneralCondition.CountryID = -1;
               GeneralCondition.EducationID = -1;
               GeneralCondition.ReligionID = -1;
               GeneralCondition.MaritalStatusID = -1;
               GeneralCondition.SmokingID = -1;
           } %>
        <div id="general-condition-edit" style="display: none;">
            <div id="general-condition-edit-fields">
                <div class="field">
                    <label class="title">Độ tuổi:</label>
                        từ <input type="text" title="Tuổi tối thiểu mà bạn mong muốn" id="txtOldMin" value="<% if (GeneralCondition.OldMin > 0) Response.Write(GeneralCondition.OldMin); %>" name="txtOldMin" class="input input-old" /> 
                        đến <input type="text" title="Tuổi tối đa mà bạn mong muốn" id="txtOldMax" value="<% if (GeneralCondition.OldMax > 0) Response.Write(GeneralCondition.OldMax); %>" name="txtOldMax" class="input input-old" />
                </div>
                <div class="field">
                    <label class="title">Chiều cao:</label>
                       từ <input type="text" title="Chiều cao tối thiểu mà bạn mong muốn" id="txtHeightMin" value="<% if (GeneralCondition.HeightMin > 0) Response.Write(GeneralCondition.HeightMin); %>" name="txtHeightMin" class="input input-height" /> 
                       đến <input type="text" title="Chiều cao tối đa mà bạn mong muốn" id="txtHeightMax" value="<% if (GeneralCondition.HeightMax > 0) Response.Write(GeneralCondition.HeightMax); %>" name="txtHeightMax" class="input input-height" /> centimet
                </div>
                <div class="field">
                    <label class="title">Cân nặng:</label>
                       từ <input type="text" title="Cân nặng tối thiểu mà bạn mong muốn" id="txtWeightMin" value="<% if (GeneralCondition.WeightMin > 0) Response.Write(GeneralCondition.WeightMin); %>" name="txtWeightMin" class="input input-weight " /> 
                       đến <input type="text" title="Cân nặng tối đa mà bạn mong muốn" id="txtWeightMax" value="<% if (GeneralCondition.WeightMax > 0) Response.Write(GeneralCondition.WeightMax); %>" name="txtWeightMax" class="input input-weight " /> kg
                </div>
                <div class="field">
                    <label class="title">Sống tại:</label>
                    <div class="right">
                        <input type="hidden" id="NumberOfCity" value="1" />
                        <div class="row">
                            <div class="select-control">
                                <select id="CoditionCity-1" name="CoditionCity-1" class="select select-city required"><%=SelectCtrlBuilder.ToSlCitiesForSearch(CityID)%></select>
                            </div>
                            <div class="add-control">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <label class="title">Nghề nghiệp:</label>
                    <div class="right">
                        <input type="hidden" id="NumberOfJob" value="1" />
                        <div class="row">
                            <div class="select-control">
                                <select id="CoditionJob-1" name="CoditionJob-1" class="select select-city required"><%=SelectCtrlBuilder.ToSlJobForSearch(JobID)%></select>
                            </div>
                            <div class="add-control">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <label class="title">Trình độ học vấn:</label>
                    <select id="CoditionEducation" name="CoditionEducation" class="select select-city required"><%=SelectCtrlBuilder.ToSlEducationForSearch(GeneralCondition.EducationID)%></select>
                </div>
                <div class="field">
                    <label class="title">Thu nhập:</label>
                    trên <select id="CoditionIncome" name="CoditionIncome" class="select select-city required"><%=SelectCtrlBuilder.ToSlIncomeForSearch(GeneralCondition.Income)%></select> VNĐ
                </div>
                <div class="field">
                    <label class="title">Tôn giáo:</label>
                    <select id="CoditionReligion" name="CoditionReligion" class="select select-city required"><%=SelectCtrlBuilder.ToSlReligionForSearch(GeneralCondition.ReligionID)%></select>
                </div>
                <div class="field">
                    <label class="title">Tình trạng hôn nhân:</label>
                    <select id="CoditionMaritalStatus" name="CoditionMaritalStatus" class="select select-city required"><%=SelectCtrlBuilder.ToSlMaritalStatusForSearch(GeneralCondition.MaritalStatusID)%></select>
                </div>
                <div class="field">
                    <label class="title">Hút thuốc:</label>    
                    <select id="CoditionSmoking" name="CoditionSmoking" class="select select-city required"><%=SelectCtrlBuilder.ToSlSmokingForSearch(GeneralCondition.SmokingID)%></select>
                </div>
            </div>
            <div class="field-edit">
                <span class="cancel-general-condition" id="cancel-general-condition">Hủy</span> <span class="save-general-condition" id="save-general-condition">Cập nhật</span>
            </div>
        </div>
    <% } %>
</div>